<?php
namespace app\api\controller;

class Login
{
    //1.登录接口
    public function wxlogin() {
        $code = input('code');
        $appId = 'wx8bbbf5ae5f0b75bc';
        $secret = '90367d59d3dfa3c0d9fbc720fb1b6d20';
        $url = 'https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code';
        $url = sprintf($url,$appId,$secret,$code);
        $data = http_request($url);
        return $data;
    }
    
}
